<?php
echo <<<HTML
<script>
    setTimeout("window.location.replace('index.php?module=admin&page=frm_inpoint')",1000);
</script>
HTML;
$jobsend_id = $_POST['jobsend_id'];
$sql = "SELECT * FROM tb_jobsend NATURAL JOIN tb_job WHERE jobsend_id = '{$jobsend_id}'";
$result = $dbfunc->query($sql);
$item = mysql_fetch_assoc($result);
$update = array(
    jobsend_score => $_POST['score']
);
if($item['job_scoretop'] < $_POST['score']){
    echo "คุณให้คะแนนมากกว่าคะแนนสูงสุด";
    exit();
}
else{
    if($dbfunc->update('tb_jobsend',$update,"jobsend_id = '{$jobsend_id}'")){
        echo "ให้คะแนนงานเรียบร้อยแล้ว";
    }
    else{
        echo "ให้คะแนนงานไม่สำเร็จ";
    }
}
?>